
VIEW_WIDTH = 800;
VIEW_HEIGHT = 600;
LINE_SPACING = 20;

drawGrid = function(context) {
  context.fillStyle = '#000';
  context.strokeRect(0, 0, VIEW_WIDTH, VIEW_HEIGHT);


  for (var x = 0; x < VIEW_WIDTH; x += LINE_SPACING) {
    context.beginPath();
    context.moveTo(x, 0);
    context.lineTo(x, VIEW_HEIGHT);
    context.stroke();
  }

  for (var y = 0; y < VIEW_HEIGHT; y += LINE_SPACING) {
    context.beginPath();
    context.moveTo(0, y);
    context.lineTo(VIEW_WIDTH, y);
    context.stroke();
  }
}